<?php

use yii\db\Migration;

/**
 * Class m181225_083055_alert_activity_table
 */
class m181225_083055_alert_activity_table extends Migration
{
    /**
     * {@inheritdoc}
     */
    public function safeUp()
    {

        $this->addColumn('{{%activity}}','share_title','string(100) comment "分享标题"');
        $this->addColumn('{{%activity}}','share_img','Text comment "分享图片"');
        $this->addColumn('{{%activity}}','share_remark','Text comment "分享文案"');
        $this->addColumn('{{%activity}}','share_url','Text comment "分享连接"');
        return true;
    }

    /**
     * {@inheritdoc}
     */
    public function safeDown()
    {
        $this->dropColumn('{{%activity}}','share_title');
        $this->dropColumn('{{%activity}}','share_img');
        $this->dropColumn('{{%activity}}','share_remark');
        $this->dropColumn('{{%activity}}','share_url');
        return true;
    }

    /*
    // Use up()/down() to run migration code without a transaction.
    public function up()
    {

    }

    public function down()
    {
        echo "m181225_083055_alert_activity_table cannot be reverted.\n";

        return false;
    }
    */
}
